﻿using CommunityToolkit.Mvvm.DependencyInjection;
using Kang.Monitor.Wpf.ViewModels;
using System.Windows;
using System.Windows.Input;

namespace Kang.Monitor.Wpf.Views
{
    /// <summary>
    /// LoginView.xaml 的交互逻辑
    /// </summary>
    public partial class LoginView : Window
    {
        private LoginViewModel loginViewModel;

        public LoginView()
        {
            InitializeComponent();
            loginViewModel = Ioc.Default.GetRequiredService<LoginViewModel>();
            this.DataContext = loginViewModel;
        }

        private void UIElement_OnMouseEnter(object sender, MouseButtonEventArgs e)
        {
            this.Close();
        }

        private void Window_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                this.DragMove();
            }
        }
    }
}